package com.ljm.boot.helloword.simpleStudy.thread;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class TestCallable {
    public static void main(String[] args) throws Exception {
        CreateCallable testCallable =  new CreateCallable();
        FutureTask<String> futureTask = new FutureTask<>(testCallable);
        Thread t1 = new Thread(futureTask);
        t1.start();
        System.out.println(futureTask.get());
    }
}
class CreateCallable implements Callable {
    @Override
    public Object call() throws Exception {
        return "1";
    }
}

